<?php use yii\helpers\Url;?>
<style type="text/css">
	td{
		padding:8px 0;
	}
	label{
		font-size: 20px;
	}
	.danger{
		font-size: 12px;
		color:red;
	}
</style>
<script  src="bootstrap/js/ajax.js"></script>
<script type="text/javascript">
function warn(warn_input){
	$(document).ready(function(){
		$('#'+warn_input).blur(function(){
				$.ajax({
				url:"<?php echo Url::to(['ajax']);?>",
				data:{
					key:warn_input,
					value:$('#'+warn_input).val()
				},
				dataType:'json',
				type:'post',
				success:function(data){
					danger = '#'+warn_input+'_danger';
					if(data!='')
					{
						$(danger).html(data);
					}
					else{
						$(danger).html('');
					}
				}
			});
		});	
	});
}
warn('title');
warn('description');
warn('content');
warn('flag');
warn('count');
warn('status');

</script>

<?=$content?>
<form action="<?php echo Url::to(['load']);?>" method="post">
	<table width="100%" >
		<tr >
			<td style="width: 10%"><label for="title" >标题:</label></td>
			<td ><input type="text" id="title" name="title" class="form-control" value="<?php echo $model['title']?>"></input></td>
		</tr>
		<tr style="">
		<td ></td>
		<td style="padding: 0px" id="title_danger" class="danger"></td>
		</tr>
		<tr>
			<td ><label for="description" >描述:</label></td>
			<td ><textarea name="description" rows="3"  id="description" class="form-control" ><?php echo $model['description']?></textarea></td>
		</tr>
		<tr style="">
		<td ></td>
		<td style="padding: 0px" id="description_danger" class="danger"></td>
		</tr>

		<tr>
			<td ><label for="content" >内容:</label></td>
			<td ><textarea name="content" rows="6"  id="content" class="form-control" ><?php echo $model['content']?></textarea></td>
		</tr>
		</tr>
		<tr style="">
		<td ></td>
		<td style="padding: 0px" id="content_danger" class="danger"></td>
		</tr>
		<tr>
			<td style="font-size: 20px;"><strong>标示：</strong></td>
			<td>
			<label for="normal" >普通 </label>
			<input type="radio" checked="checked" id="normal" name= "flag" value="0" style="margin-right:20px;"/>
			<label for="hot" >热门 </label>
			<input type="radio" id="hot" value="1" name= "flag" style="margin-right:20px;"/>
			<label for="top">置顶 </label>
			<input type="radio"  id="top" value="2" name= "flag" style="margin-right:20px;"/>
			</td>
		</tr>
		<tr style="">
		<td ></td>
		<td style="padding: 0px" id="flag_danger" class="danger"></td>
		</tr>
		<tr>
			<td ><label for="count" >浏览次数:</label></td>
			<td ><input type="text" name="count" rows="8"  id="count" class="form-control"/ value="<?php echo $model['count']?>"></td>
		</tr>
		<tr style="">
		<td ></td>
		<td style="padding: 0px" id="count_danger" class="danger"></td>
		</tr>
		<tr>
			<td ><label for="status" >状态:</label></td>
			<td ><select class="form-control" name="status">
				<option value="1">是</option>
				<option value="0">否</option>
			</select></td>
		</tr>
		<tr style="">
		<td ></td>
		<td style="padding: 0px" id="status_danger" class="danger"></td>
		</tr>
		<tr>
			<td colspan="2">
				<div class="col-xs-2 col-xs-offset-4">
				<input type="submit" value="提交" class="btn btn-success btn-lg " ></input>
				</div>
				<div class="col-xs-2 ">
				<a class="btn btn-default btn-lg" href="<?php echo Url::to(['index']);?>">返回</a>
				</div>
			</td>
		</tr>
	</table>
</form>





















<!--<style>
	*,html,body{
	margin: 0;
	padding； 0；
}
</style>
<form >
	<div class="" style="display: table;width: 100%;padding: 0;vertical-align: middle;">
		<div class="" style="border: 2px solid red;display: table-cell;height: 50px; padding: 0;vertical-align: middle;text-align: center;">
			<label style="border: 1px solid red;">标题：</label>
		</div>
		<div class="" style="border: 2px solid red;display: table-cell;">
			<input style="width: 100%;height: 100%;" type="text" class="" id="title"></input>
		</div>
	</div>
</form>-->